<!DOCTYPE html>
<html>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="../static/jquery-3.3.1.min.js"></script>

<body>
    <h1>ajax请求允许跨域</h1>
    <script type="text/javascript">
    $(function() {
        $.ajax({
            url: "http://localhost:8080/hello",
            type: "GET",
            dataType: "json",
            success: function(data, status) {
                console.log("成功");
            },
            error: function(data) {
                console.log("错误");
            }
        });
    });
    </script>
</body>

</html>